<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: 'App',
  created() {
    // 全局错误处理
    this.$nextTick(() => {
      window.addEventListener('unhandledrejection', (event) => {
        this.$message.error(event.reason.message || '请求失败')
      })
    })
  }
}
</script>

<style>
#app {
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  height: 100%;
}

/* 全局样式重置 */
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* 全局滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(144, 147, 153, 0.3);
  border-radius: 3px;
}

/* 全局表单样式 */
.el-form-item__label {
  font-weight: bold;
}

/* 全局表格样式 */
.el-table {
  margin-top: 20px;
}

/* 全局按钮间距 */
.el-button {
  margin-right: 10px;
}
</style>